<?php

return [
    'reward_log' => function ($schema, $table) {
        $schema->createOrUpdate($table, function ($table) {
            $table->increments('id')->comment('ID');
            $table->string('user_id', 32)->default('')->comment('角色id');
            $table->string('server_id', 32)->default('')->comment('服务器id');
            $table->tinyInteger('reward_type')->default(0)->comment('奖励类型 1分享奖励 2生成一次年终报告周年奖励');
            $table->tinyInteger('status')->default(0)->comment('状态 0未领取 1已领取');
            $table->integer('create_time')->unsigned()->default(0)->comment('创建时间');
            $table->integer('update_time')->unsigned()->default(0)->comment('更新时间');
            $table->unique(['user_id', 'reward_type']);
            $table->comment = '领奖记录表';
            $table->engine = 'innodb';
        });
    },
    'share_uid' => function ($schema, $table) {
        $schema->createOrUpdate($table, function ($table) {
            $table->increments('id')->comment('ID');
            $table->string('share_uid', 32)->default('')->comment('分享角色id');
            $table->string('share_info', 1024)->default('')->comment('分享信息');
            $table->integer('create_time')->unsigned()->default(0)->comment('创建时间');
            $table->integer('update_time')->unsigned()->default(0)->comment('更新时间');
            $table->unique('share_uid');
            $table->comment = 'uid映射表';
            $table->engine = 'innodb';
        });
    },
];
